<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateHandroomsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('handrooms', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('community_id')->unsigned()->comment('所属小区');
            $table->string('communityname')->nullable()->comment('小区名');
            $table->integer('province')->unsigned()->nullable()->comment('省id');
            $table->string('provincename')->nullable()->comment('省');
            $table->integer('region')->unsigned()->nullable()->comment('所属区域id');
            $table->string('regionname')->nullable()->comment('楼盘所属区域名称');
            $table->integer('area')->unsigned()->nullable()->comment('区id');
            $table->string('areaname')->nullable()->comment('区/县');
            $table->integer('town_id')->unsigned()->nullable()->comment('镇id');
            $table->string('town')->nullable()->comment('镇');
            $table->integer('metro_id')->unsigned()->nullable()->comment('地铁线id');
            $table->integer('metro_station_id')->unsigned()->nullable()->comment('地铁站id');
            $table->string('title')->comment('房源名称');
            $table->tinyInteger('room')->unsigned()->default(1)->comment('室');
            $table->tinyInteger('hall')->unsigned()->default(0)->comment('厅');
            $table->tinyInteger('kitchen')->unsigned()->default(0)->comment('厨');
            $table->tinyInteger('toilet')->unsigned()->default(0)->comment('卫');
            $table->integer('acreage')->unsigned()->comment('面积');
            $table->integer('price')->nullable()->unsigned()->default(0)->comment('总价');
            $table->integer('category_id')->unsigned()->nullable()->comment('朝向');
            $table->string('address')->comment('房源地址');
            $table->string('floor')->nullable()->comment('楼层：底层 中层 高层');
            $table->tinyInteger('floor_num')->nullable()->comment('总楼层数');
            $table->integer('year')->nullable()->unsigned()->comment('建筑年代');
            $table->string('map')->nullable()->comment('地图坐标');
            $table->string('longitude')->nullable()->comment('经度');
            $table->string('latitude')->nullable()->comment('纬度');
            $table->integer('renovation')->unsigned()->nullable()->comment('装修情况');
            $table->string('contact_name')->nullable()->comment('联系人');
            $table->string('contact_tel')->nullable()->comment('联系电话');
            $table->string('supporting')->nullable()->comment('配套设施');
            $table->integer('pm_type')->unsigned()->nullable()->comment('物业类型');
            $table->string('tags')->nullable()->comment('特色标签');
            $table->string('rec')->nullable()->default('F')->comment('推荐位');
            $table->tinyInteger('daytime')->nullable()->comment('有效期');
            $table->string('thumb')->nullable()->comment('缩略图');
            $table->text('images')->nullable()->comment('房源图片');
            $table->string('overall_view')->nullable()->comment('全景看房');
            $table->text('content')->nullable()->comment('房源介绍');
            $table->string('seo_title')->nullable()->comment('seo标题');
            $table->string('seo_keywords')->nullable()->comment('seo关键词');
            $table->string('seo_description')->nullable()->comment('seo描述');
            $table->string('status')->default('T')->comment('状态 T 启用 F 禁用');
            $table->integer('follow')->default(0)->nullable()->comment('关注数');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('handrooms');
    }
}
